/********************/
/*ENOURMUS thanks	*/
/*goes to betajaen, */
/*the creator of	*/
/*NxOgre, and		*/
/*Derek Nedelman,	*/
/*the creator of	*/
/*Ogre Max.			*/
/*I REALLY			*/
/*appreciate your	*/
/*work!				*/
/********************/

#include <Ogre.h>
#include <OgreMaxScene.hpp>
#include <NxOgre.h>
#include <iostream>
using namespace OgreMax;

class OgreMaxSceneCallbacks : public OgreMaxSceneCallback
{
protected:
	NxOgre::World* NxWorld; //This one creates the scene
	NxOgre::Scene* NxScene; //The scene which things get's all physics.
	Ogre::Vector3 mScenePosition;
public:
	OgreMaxSceneCallbacks (NxOgre::Scene* s);
	OgreMaxSceneCallbacks (NxOgre::World* w,Ogre::Vector3 initPos);

	/*Custom*/
	virtual Ogre::Real getNumber (Ogre::String &param, Ogre::String::iterator& it);
	virtual Ogre::Real getSphereSize (Ogre::String &param, Ogre::String::iterator it);
	virtual Ogre::Vector3 getCubeSize (Ogre::String &param, Ogre::String::iterator it);

	virtual NxVec3 getPlaneNormal(Ogre::String &param, Ogre::String::iterator it);
	virtual NxReal getPlaneDistance(Ogre::String &param, Ogre::String::iterator it);
	virtual NxVec3 getCapsuleSize(Ogre::String &param, Ogre::String::iterator it);
	

	virtual NxOgre::Convex* getConvex (Ogre::String &param, Ogre::String::iterator it);
	virtual NxOgre::TriangleMesh* getTriangle (Ogre::String &param, Ogre::String::iterator it);
	virtual Ogre::String getFirstParam (Ogre::String param);
	
	virtual NxOgre::Shape* getShape (Ogre::String param);
	virtual NxOgre::SimpleShape* getSimpleShape (Ogre::String param);
	Ogre::String getMeshName (Ogre::String param);

	virtual Ogre::String getLastParam (Ogre::String param);
	virtual Ogre::String getParamValue (Ogre::String paramName,Ogre::String param);

	virtual void rotateActor (NxOgre::Actor* actor, Ogre::String params);
	virtual void CreateWorld (Ogre::String allParams);
	NxOgre::Scene* getScene () {return NxScene;}

	bool generateNXS(Ogre::String &param);

	/*Ogre Max*/
	virtual void LoadingSceneFile(const OgreMaxScene* scene, const Ogre::String& fileName, Ogre::String& resourceGroupName);
	virtual void LoadedUserData (const OgreMax::OgreMaxScene *scene, const Ogre::String &userDataReference, const Ogre::String &userData);
	virtual void CreatedEntity (const OgreMax::OgreMaxScene* scene, Ogre::Entity* entity);
	virtual void FinishedLoad (const OgreMax::OgreMaxScene* scene, bool success);
};